#include <iostream>
using namespace std;

class A
{
public:
    A(int a, int b)
    {
        this->a = a;
        this->b = b;
    }

    virtual void print()
    {
        printf("a = %d, b = %d\n", this->a, this->b);
    }
    //纯虚函数
    /* 抽象类：一个类里如果由纯虚函数，那么这个类就是抽象类。
    特点：含有纯虚函数的类，不可以实例化（不可以创建对象） */
    virtual void test() = 0;
    
protected:
    int a;
    int b;
};

#if 0
class B:public A
{
public:
    B(int a, int b, int c):A(a,b)
    {
        this->c = c;
    }
    void print()
    {
        printf("a = %d, b = %d, c = %d\n", this->a, this->b, this->c);
    }
private:
    int c;
};
#endif

void print(A * p)
{
    p->print();
}

int main()
{
    return 0;
}